"getSymbols.vadbID" <- function(Symbols, env, return.class="xts", Sappend=".vadb",
                                datefrom="1990-01-01", dateto=NULL, includeOI=FALSE,
                                user=NULL, password=NULL, dbname=NULL, host=NULL, ...) {
  
  # todo: code for several Symbols-items
  
  # default settings
  #if (is.null(user)) user <- "va"
  #if (is.null(password)) password <- "dummy"
  #if (is.null(dbname)) dbname <- "va_stratlab"
  #if (is.null(host)) host <- "localhost"
  
  importDefaults("getSymbols.vadbID")
  this.env <- environment()
  for(var in names(list(...))) {
    assign(var,list(...)[[var]], this.env)
  }
  
  # additional defaults to be saved
  # used if getSymbolLookup has been set
  # for a specific SYMBOL
  
  default.return.class <- return.class
  
  if(missing(verbose)) verbose <- FALSE
  if(missing(auto.assign)) auto.assign <- TRUE
  
  if (includeOI==TRUE) {
    oi <- ",oi"
  } else {
    oi <- ""
  }
  
  # connect to database
  con <- connectToVadb()
  
  for(i in 1:length(Symbols)) {
    # query db for symbol code
    sql <- sprintf ("SELECT `code` FROM `stockname` WHERE `id` = %s", Symbols[[i]])
    code <- dbGetQuery(con, sql)[,1]
    
    # repeat the following 2 assignments for all default arguments
    return.class <- getSymbolLookup()[[code[[i]]]]$return.class
    return.class <- ifelse(is.null(return.class), default.return.class, return.class)
    
    if(verbose) cat("loading ",code,".....")
    
    # Build SQL Command
    sql <- sprintf ("SELECT date,open,high,low,close,volume%s 
                    FROM stockprice WHERE stock_id='%s'",oi, Symbols[[i]])
    if (!is.null(datefrom)) {
      sql <- paste (sql, sprintf ("AND date>='%s'", datefrom), SEP="")
    }
    if (!is.null(dateto)) {
      sql <- paste (sql, sprintf ("AND date<='%s'", dateto), SEP="")
    }
    # exclude holidays (day without trades)
    sql <- paste (sql,"HAVING !(open=high && high=low && low=close && volume=0)", SEP="")
    sql <- paste (sql,"ORDER BY `date`", SEP="")
    
    if (verbose) {
      cat("start of dbGetQuery : ")
      start_t<-Sys.time()
    }
    fr <- dbGetQuery(con, sql)
    if (verbose) {
      cat("end of dbGetQuery : \n")
      end_t<-Sys.time()
      print(end_t-start_t)
    }
    
    # convert to a zoo/xts object. indexing by proper format
    #fr <- zoo(fr[,-1],as.Date(fr[,1],origin='1970-01-01'))
    fr <- xts(fr[,-1], as.Date(fr$date, tz="UTC"), src="vadb", updated=Sys.time(), tzone="")
    
    # change colnames if necessary.  Following handle OHLC code from yahoo
    if (includeOI==TRUE) {
      colnames(fr) <- paste(toupper(gsub('\\^','',code[[i]])),
                            c('Open','High','Low','Close','Volume','OI'),sep='.')
    } else {
      colnames(fr) <- paste(toupper(gsub('\\^','',code[[i]])),
                            c('Open','High','Low','Close','Volume'),sep='.')      
    }
    
    # convert.time.series to whichever class is specified by 'return.class'
    #fr <- quantmod:::convert.time.series(fr=fr,return.class=return.class)
    
    if(auto.assign)
      assign(paste(code, Sappend, sep=""), fr, env)
    if(verbose)  
      cat("done.\n")
  }
  dbDisconnect(con)
  
  if(auto.assign) return(code)
  return(fr)
}